package pk1;

import sun.reflect.generics.reflectiveObjects.NotImplementedException;

import java.io.*;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Objects;
import java.util.stream.IntStream;

interface A {
    default void test() {
        System.out.println("A");
    }
}

interface B {

}

class Ab implements A, B {
    public void main(String[] args) {
        FileWriter fileWriter = null;
        try {
//            fileWriter.a();
            fileWriter = new FileWriter("c:\\hello.txt");
            fileWriter.write("111");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (fileWriter != null) {
                    fileWriter.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    @Override
    public void test() {
        throw new NotImplementedException();
    }
}

public class Main implements Serializable {
    public static void main(String[] args) throws ParseException {
        DateFormat fm = new SimpleDateFormat("yyyy-MM-dd");

        Date date = fm.parse("2020-08-5");
        Date now = new Date();
        System.out.println(now.getYear());
        System.out.println(now.getMonth());
        System.out.println(now.getDay());
        Calendar cd = Calendar.getInstance();
        int i1 = cd.get(Calendar.HOUR);
        System.out.println("year:" + i1);
        long i = now.getTime() - date.getTime();
        System.out.println(fm.format(date));
        System.out.println(fm.format(now));
        System.out.println((i / (24 * 60 * 60 * 1000)));


        Date date1 = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
        System.out.println("now:" + dateFormat.format(date1));
        double a = 100;
        int[] aa = new int[10];
        for (int a1 : aa) {
            System.out.println(a1);
        }
        Ab ab = new Ab();
        ab.main(null);
        "Objects.equals()".equals("asdasd");

    }
}
